package com.example.money.Controller;

import com.example.money.Entity.add;
import com.example.money.Service.AddService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
public class AddController {
    @Autowired
    private AddService addService;

    @PostMapping(value = "/add")
    @ResponseBody
    public String  add(add add){
        boolean i=addService.add(add);
        System.out.println("收到数据"+add);
        if (i){
            return "增加成功！";
        }else {
            return "增加失败！";
        }
    }
}
